package ex107;

public class Util {
    public double getE(int n) {
        double result = 1.0;
        double factorial = 1.0;
        for (int i = 1; i <= n; i++) {
            factorial *= i; // 计算i!
            result += 1.0 / factorial;
        }
        return result;
    }
}
